<template>
	<view>

		<map style="width: 100vw; height: 100vh;" :scale="14" dottedLine="true" :markers="markers" :latitude="latitude" :longitude="longitude" :polyline="polyline">

		<!-- <map style="width: 100vw; height: 100vh;" :scale="15" :latitude="latitude" :longitude="longitude" :polyline="polyline"> -->
<image src="../../../static/icon/dizhi.png"></image>
		</map>
	</view>
</template>

<script>
	import Amap from '@/js_sdk/Lyn4ever-gaodeRoutePlanning/lyn4ever-gaode.js';
	export default {
		data() {
			return {
				longitude: 107.486174,
				latitude: 31.209493,
				
				markers: [],
				polyline: []
			};

		},
		onLoad() {
			// let that = this;
			// var startPoi = "108.921672,34.250646";
			// var wayPoi =
			// 	"108.936799,34.245842;108.973306,34.244767;109.013335,34.249303";
			// var endPoi = "109.033673,34.252884";
			// var dd = []

			// Amap.line(startPoi, endPoi, wayPoi, function(res) {
			// 	that.polyline.push(res)
			// });

			// Amap.markers(startPoi, endPoi, wayPoi, function(res) {
			// 	that.markers.push.apply(that.markers, res)
			// })

		},
		onShow() {

		},
		mounted() {
			this.getuserTrack()
		},
		methods: {
			getuserTrack() {
				this.$u.api.getuserTrack()
					.then(res => {
						// console.log(res)
						let list = res.result.map((data) => {
							return {
								latitude: data.latitude,
								longitude: data.longitude,
								iconPath:'../../../static/icon/dingwei.png',
								id:'1'
							}
						})
						this.markers = list
						this.polyline = [{
							points: list,
							color: "#0000FF",
							width: 5,
							arrowLine: true,
							dottedLine: false
						}]
					})
					.catch(err => {
						console.log(err)
					})
			}
		}
	}
</script>

<style lang="less">
</style>
